#!/usr/bin/python

#Provides Notifications for new emails

import pynotify
from time import strftime

def notify(parsed):
	if (parsed['feed']['fullcount'] == '0'):
		#no need for notification if no unread mails
		pass
	else:
		#if there are new mails, then issue a notification for each item
		pynotify.init("icon-summary-body")
		for entry in parsed['entries']:
			n=pynotify.Notification(entry['title'],strftime("%x %X",entry['published_parsed']) + "\n" + entry['author'] + "\n" + entry['summary'],"notification-message-IM")
			n.show()
